﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Layout.master" AutoEventWireup="true" CodeFile="lich_su_mua_hang.aspx.cs" Inherits="lich_su_mua_hang" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <div class="block" id="block-tables">
        <div class="content" style="background: #fff; padding:5px;">
            <h1 class="title">
                Lịch sử mua hàng</h1>
            <div class="inner">
              
                <style type="text/css">
                    .table 
                    {
                        width: 98%;
                        border:none;
                    }
                    .table th, .table td
                    {
                        padding: 9px 5px;
                        border: none;
                    }
                    .table th
                    {
                        background: #bbb;
                    }
                    .table td
                    {
                        border-bottom: 1px solid #bbb;
                    }
                </style>
                <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSourceLichSuMuaHang"
                    AutoGenerateColumns="False" CssClass="table" PageSize="3" 
                    DataKeyNames="id">
                    <Columns>
                        <asp:BoundField DataField="ten_sp" HeaderText="Tên khuyến mãi" 
                            SortExpression="ten_sp" />
                        <asp:BoundField DataField="mo_ta_sp" HeaderText="Mô  tả khuyến mãi" 
                            SortExpression="mo_ta_sp" />
                        <asp:BoundField DataField="gia_goc" HeaderText="Giá" 
                            SortExpression="gia_goc" />
                        <asp:BoundField DataField="da_thanh_toan" HeaderText="Thanh Toán" 
                            SortExpression="da_thanh_toan" />
                    </Columns>
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSourceLichSuMuaHang" runat="server" ConnectionString="<%$ ConnectionStrings:babydealConnectionString %>"
                    
                    SelectCommand="SELECT thanh_vien.ho_ten, thanh_vien.so_dt, thanh_vien.dia_chi, khuyen_mai.ten_sp, khuyen_mai.mo_ta_sp, mua_hang.id, mua_hang.gia_goc, mua_hang.da_thanh_toan FROM mua_hang INNER JOIN thanh_vien ON mua_hang.id_thanh_vien = thanh_vien.id INNER JOIN khuyen_mai ON mua_hang.id_khuyen_mai = khuyen_mai.id WHERE (thanh_vien.ten_dang_nhap = @ho_ten)">
                    <SelectParameters>
                        <asp:SessionParameter DefaultValue="%%" Name="ho_ten" 
                            SessionField="TenDangNhap" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <div class="actions-bar wat-cf">
                </div>
            </div>
        </div>
    </div>
</asp:Content>

